/* indent size: 2 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Model = app.model.define('user', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    username: {
      type: DataTypes.STRING(256),
      allowNull: true
    },
    password: {
      type: DataTypes.STRING(256),
      allowNull: true
    },
    gender: {
      type: DataTypes.INTEGER(11),
      allowNull: true
    },
    birthday: {
      type: DataTypes.INTEGER(11),
      allowNull: true
    },
    register_time: {
      type: DataTypes.BIGINT,
      allowNull: true
    },
    last_login_time: {
      type: DataTypes.BIGINT,
      allowNull: true
    },
    last_login_ip: {
      type: DataTypes.STRING(256),
      allowNull: true
    },
    register_ip: {
      type: DataTypes.STRING(256),
      allowNull: true
    },
    nickname: {
      type: DataTypes.STRING(256),
      allowNull: true
    },
    phonenumber: {
      type: DataTypes.STRING(128),
      allowNull: true
    },
    avatar: {
      type: DataTypes.STRING(256),
      allowNull: true
    },
    weixin_openid: {
      type: DataTypes.STRING(128),
      allowNull: true
    }
  }, {
    tableName: 'user'
  });

  Model.associate = function() {

  }

  return Model;
};
